//index.js
//获取应用实例
var imageUtil = require('../../utils/util.js'); 
Page({
  onLaunch:function(){
    console.log("hello");
  },
  data: {
    imgUrls: [
      {url:'./imgs/banner.jpg'},
      {url:'./imgs/banner01.jpg'},
    ],
    indicatorDots: false,
    autoplay: false,
    interval: 5000,
    duration: 1000,
    imagewidth: 0,//缩放后的宽  
    imageheight: 0,//缩放后的高
    bimagewidth: 0,//缩放后的宽  
    bimageheight: 0,//缩放后的高
  },
  toast:function(e){
    wx.navigateTo({
      url: '../index/goods_detail'
    })
  },
  changeIndicatorDots: function(e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay: function(e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  intervalChange: function(e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange: function(e) {
    this.setData({
      duration: e.detail.value
    })
  },
  imageLoad: function (e) {  
    var imageSize = imageUtil.imageUtil(e)  
    this.setData({  
      imagewidth: imageSize.imageWidth,  
      imageheight: imageSize.imageHeight  
    })  
  },
  imageLoad2: function (e) {  
    var imageSize = imageUtil.imageUtil(e)  
    this.setData({  
      bimagewidth: imageSize.imageWidth,  
      bimageheight: imageSize.imageHeight  
    })  
  }
})